/*
 * Copyright 2002-2014 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ls.fw.data.impl.test.domain;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Version;
import org.springframework.data.elasticsearch.annotations.Document;



/**
 * Simple JavaBean domain object representing an person.
 *
 * @author Rod Johnson
 */
@Document(indexName = "person", type = "person", indexStoreType = "memory", shards = 1, replicas = 0, refreshInterval = "-1")
public class Person implements Serializable{
	@Id
	private String id;

	// Lazy relagtionship to force use of instrumentation in JPA implementation.
	private DriversLicense driversLicense;

	private String first_name;

	private String last_name;


	private Integer age = 0;
	
	private Date birthday = null;
	
	private Timestamp creattime = null;
	
	@Version
	private Long version;

	public Long getVersion() {
		return version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}
	public String getId() {
		return id;
	}

	public void setFirstName(String firstName) {
		this.first_name = firstName;
	}

	public String getFirstName() {
		return this.first_name;
	}

	public void setLastName(String lastName) {
		this.last_name = lastName;
	}

	public String getLastName() {
		return this.last_name;
	}

	public void setDriversLicense(DriversLicense driversLicense) {
		this.driversLicense = driversLicense;
	}

	public DriversLicense getDriversLicense() {
		return this.driversLicense;
	}


	/**
	 * @return the birthday
	 */
	public Date getBirthday() {
		return birthday;
	}

	/**
	 * @param birthday the birthday to set
	 */
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	/**
	 * @return the age
	 */
	public Integer getAge() {
		return age;
	}

	/**
	 * @param age the age to set
	 */
	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public String toString() {
		return "Person [id=" + this.id + ", driversLicense="
				+ this.driversLicense + ", first_name=" + this.first_name
				+ ", last_name=" + this.last_name + ", age=" + this.age
				+ ", birthday=" + this.birthday + ", creattime="
				+ this.creattime + "]";
	}

	/**
	 * @return the creattime
	 */
	public Timestamp getCreattime() {
		return creattime;
	}

	/**
	 * @param creattime the creattime to set
	 */
	public void setCreattime(Timestamp creattime) {
		this.creattime = creattime;
	}

	public String getFirst_name() {
		return this.first_name;
	}

	public void setFirst_name(String first_name) {
		this.first_name = first_name;
	}

	public String getLast_name() {
		return this.last_name;
	}

	public void setLast_name(String last_name) {
		this.last_name = last_name;
	}

	public void setId(String id) {
		this.id = id;
	}

}
